<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">

<f:view contentType="text/html">
	<h:head>
		<f:facet name="first">
			<meta http-equiv="X-UA-Compatible" content="EmulateIE8" />
			<meta content='text/html; charset=UTF-8' http-equiv="Content-Type" />
			<title>RUPECM - Login</title>
		</f:facet>

		<h:outputStylesheet library="css" name="default.css" />

		<style type="text/css">
			.ui-layout-north {
				overflow: visible !important;
			}
			
			.ui-layout-north .ui-layout-unit-content {
				overflow: visible !important;
			}
			
			.ui-layout-north .ui-layout-unit-content {
				background-image: url('#{request.contextPath}/resources/images/backtop.png');
				
			}
		</style>

		<!-- ICONE PAGINA -->
		<link rel="shortcut icon" type="image/x-icon"
			href="#{request.contextPath}/images/favicon.ico" />
	</h:head>
	<h:body>

		<!-- LAYOUT GERAL -->
		<p:layout fullPage="true">

			<!-- TITULO -->
			<p:layoutUnit id="titulo" position="north" size="70" style="text-align:right; font-weight: bold; font-size:145%;"> 
					
				<div style="width:100%; padding-bottom: 50px">   
					<h:form>
						<!-- <p:commandLink action="principalRecurso.jsf">  -->
							<h:graphicImage value="/resources/images/logo_small.png" height="45" style="border:0; padding-right: 30px; padding-bottom: 20px"/>
						<!-- </p:commandLink>  -->
					</h:form>
				</div>  	 
			</p:layoutUnit>

			<!-- CORPO -->
			<p:layoutUnit id="center" position="center" style="border:0px;">
				<form id="login" method="post"
					action="${request.contextPath}/j_spring_security_check">

					<p:dialog id="dialog" header="Login" widgetVar="dlg"
						resizable="false" closable="false" visible="true" width="250px">

						<table>
							<tr>
								<td>Login</td>
								<td><input type='text' name='j_username' /></td>
							</tr>
							<tr>
								<td>Senha</td>
								<td><input type='password' name='j_password' /></td>
							</tr>
							<tr>
								<td align="right"><input type="checkbox"
									name="_spring_security_remember_me" /></td>
								<td>Entrar automaticamente</td>
							</tr>
							<tr>
								<td></td>
								<td><input type="submit" value="Entrar"/></td>
							</tr>
						</table>
<!-- 						<script>
							document.getElementById("login").j_username.value = "#{SPRING_SECURITY_LAST_USERNAME}";
						</script> -->

						<h:panelGroup rendered="#{!empty message}" style="font-size:100%; float:center;">
								<h:outputText value="#{SPRING_SECURITY_LAST_EXCEPTION.message}" style="font-weight:bold;font-size:100%;" />						
						</h:panelGroup>
					</p:dialog>
				</form>
			</p:layoutUnit>
			<!-- FOOTER -->
			<p:layoutUnit id="bottom" position="south" size="50">
				<ui:insert name="rodape">
					<ui:include src="/publico/rodape.xhtml" />
				</ui:insert>
			</p:layoutUnit>
			<!-- FIM LAYOUT -->
		</p:layout>
	</h:body>
</f:view>
</html>
